package com.hc.core.util.pageStatic;

import java.io.FileInputStream;
import java.util.Properties;
import java.util.TimerTask;
import javax.servlet.ServletContext;


public class IndexToHtmlTask extends TimerTask {

	private static ServletContext sc = null;

	public IndexToHtmlTask(ServletContext servletContext) {
		this.sc = servletContext;
	}

	// 继承了TimerTask类
	public void run() {
		String url = "";
		
		Properties properties = new Properties();
		FileInputStream fs = null;
		try {
			fs = new FileInputStream(sc.getRealPath("") + "WEB-INF/config/config.properties");
			properties.load(fs);
			
			//从配置文件中获取url
			url =  properties.getProperty("index.static.url");
		} catch (Exception e) {
			e.printStackTrace();
		}finally{
			fs = null;
			properties = null;
		}
		try {   
            HttpRequester request = new HttpRequester();   
            HttpRespons hr = request.sendGet(url);   
        } catch (Exception e) {   
            e.printStackTrace();   
        } 
	}
}